<?php

namespace Fuel\Migrations;

class Create_cinema
{
	public function up()
	{
		\DBUtil::create_table('cinema', array(
                        'id' => array('constraint' => 11, 'type' => 'smallint', 'auto_increment' => true),
			'name' => array('constraint' => 120, 'type' => 'varchar'),
			'address' => array('constraint' => 200, 'type' => 'varchar'),
			'logo' => array('constraint' => 50, 'type' => 'varchar'),
			'slogan' => array('constraint' => 500, 'type' => 'varchar')

		), array('id'));
                
                
	    $cinema_info = \Model_Orm_Cinema::forge();
            $cinema_info->name = 'Cinema IS';
            $cinema_info->address = 'Riga street 12, Riga, Latvia';
            $cinema_info->logo = "default_logo.png";
            $cinema_info->slogan = "Movies for you !";
	    $cinema_info->save();
	}

	public function down()
	{
		\DBUtil::drop_table('cinema');
	}
}